public class Time {
	private int hour;
	private int minute;
	private int second;
	
	public int getHour() {
		return hour;
	}

	public void setHour(int hour) {
		if (0 <= hour && hour <= 23) {
			this.hour = hour;
		}
	}

	public int getMinute() {
		return minute;
	}

	public void setMinute(int minute) {
		if (0 <= minute && minute <= 59) {
			this.minute = minute;
		}
	}

	public int getSecond() {
		return second;
	}

	public void setSecond(int second) {
		if (0 <= second && second <= 59) {
			this.second = second;
		}
	}

	public Time() {
		hour = 0;
		minute = 0;
		second = 0;
	}
	
	public Time(int hour, int minute, int second) {
		this.hour = hour;
		this.minute = minute;
		this.second = second;
		if (!isValidTime()) {
			this.hour = 0;
			this.minute = 0;
			this.second = 0;
		}
	}
	
	public void print() {
		System.out.println(hour + ":" + minute + ":" + second);
	}
	
	public boolean isValidTime() {
		if (hour < 0 || hour > 23) {
			return false;
		}
		if (minute < 0 || minute > 59) {
			return false;
		}
		if (second < 0 || second > 59) {
			return false;
		}
		return true;
	}
	
	public int getSecondsFromBOD() {
		return (hour * 3600 + minute * 60 + second);	
	}
}
